<script id="users" type="text/template">
<% if (names.length) { %>
<ul>
    <% names.forEach(function(name){ %>
    <li><%= name %></li>
    <% }) %>
</ul>
<% } %>
</script>
<script>
    console.log(ejs)
    var users =$('#users').html();
    var names = ['loki', 'tobi', 'jane'];
    var html = ejs.render(users, { names: names });
    $('body').append(html)
</script>